<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <link rel="stylesheet" href="model.css" /> 
  
   <?php include("head.php"); ?>
 <?php include("entete.php"); ?>
   <?php include("menu.php"); ?>
<?php
 

try{
  $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
  $bdd = new PDO('mysql:host='.DB_SERVER.';dbname='.DB_DATABASE, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, $pdo_options);
  

  echo '<p>
Création de l\'évènement.<br />
Veuillez choisir le nom de l`association organisatrice:<br />
</p>'; 
  $sql = "SELECT NOM_ASSOC, ID_ASSOC FROM ASSOCIATION ORDER BY NOM_ASSOC";
  
  $reponse = $bdd->query($sql);?>
    
    <form action="ajouter_evt.php" method="post">
       <select name="id_assoc">
       <?php
       while ($donnees=$reponse->fetch()){ ?>
					   <option value= <?php echo "$donnees[ID_ASSOC]"; ?>><?php echo $donnees['NOM_ASSOC']; ?></option>							       <?php  } ?>
</select><br /><br />

    <?php echo 'Nom de l\'évènement: '; ?>
       
       <input type="text" name="nom_evt" /> <br />
	  <br />
	  Veuillez entrer la description:<br />
	  
	  <textarea name="description" rows="8" cols="45">Votre description ici.
	  </textarea><br/>
	  <br />
	  
	  Cout: <br />
	  <input type="text" name="cout" /> <br />
	  nombre de places:<br />
	  
	  <input type="text" name="places" /> <br />
	  
	  lieu:<br />
	  <input type="text" name="lieu" /> <br />
	  
	  fréquence:<br />
	  <select name="frequence">
	  <option value="quotidien">Quotidien</option>
	  <option value="hebdomadaire">Hebdomadaire</option>
	  <option value="mensuel">Mensuel</option>
	  <option value="annuel">Annuel</option>
	  </select><br />
	  
	  date de début:<br />
	  <input type="text" name="debut" /> <br />
	  
	  date de fin:<br />
	  <input type="text" name="fin" /> <br />
	  
	  tarif adhérent:<br />
	  <input type="text" name="tarif_adherent" /> <br />
	  
	  tarif exté:<br />
	  <input type="text" name="tarif_exte" /> <br />
	  
	  <input type="submit" value="Valider" />
	  </p>
	  </form>
	  <?php	  
	  }

catch (Exception $e)
{
  die('Erreur : ' . $e->getMessage());
} 
?>